]> dgit.raspbian.org Git - gnome-shell.git/commitdiff
screenShield: Remove erroneous top/bottom padding that may appear
authorJasper St. Pierre <jstpierre@mecheye.net>
Wed, 10 Oct 2012 21:20:16 +0000 (18:20 -0300)
committerJasper St. Pierre <jstpierre@mecheye.net>
Thu, 11 Oct 2012 15:26:00 +0000 (12:26 -0300)
If there are either no resident or persistent notifications, we'll
add some spacing for those boxes that may contain nothing. Make them
invisible to remove the spacing for those elements. It's possible
that we may want to be smarter about this in StBoxLayout to remove
spacing for zero-sized actors, but today is not the day.

https://bugzilla.gnome.org/show_bug.cgi?id=685919

js/ui/screenShield.js

index 8f480d4cc0dd6e8938886018c45a0df7fef1d6d9..0e5557eb0bee58ecafb6fa5502943a31701088b7 100644 (file)
@@ -126,13 +126,12 @@ const NotificationsBox = new Lang.Class({
     },
 
     _updateVisibility: function() {
-        if (this._residentNotificationBox.get_n_children() > 0) {
-            this.actor.show();
-            return;
-        }
+        this._residentNotificationBox.visible = this._residentNotificationBox.get_n_children() > 0;
+        this._persistentNotificationBox.visible = this._persistentNotificationBox.get_children().some(function(a) {
+            return a.visible;
+        });
 
-        let children = this._persistentNotificationBox.get_children();
-        this.actor.visible = children.some(function(a) { return a.visible; });
+        this.actor.visible = this._residentNotificationBox.visible || this._persistentNotificationBox.visible;
     },
 
     _sourceIsResident: function(source) {